const path = require('path');
const webpackMerge = require('webpack-merge');
const baseConfig = require('./webpack.base.config');
const fs = require('fs-extra');

const config = webpackMerge(baseConfig, {
    mode: "production",
    devtool: 'inline-source-map',
    /*输出到dist文件夹，输出文件名字为index.js*/
    output: {
        filename: 'static/[name].[chunkhash].js' //chunkhash:根据自身的内容计算而来
    },
    devtool: false
});

fs.writeFile(path.join(__dirname, '../log/config/pro.json'), JSON.stringify(config, null, '\t'), function () { });

module.exports = config;